<%-- jsp的指令--%>
<%@page pageEncoding="utf-8" contentType="text/html; charset=UTF-8" isELIgnored="false" %>
<%-- 导入JSTL标签库--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
	<title>user_list</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="css/style.css" />
	<script type="text/javascript" src="js/jQuery-v3.4.1.js"></script>
	<script type="text/javascript">
		$(function () {
			$("#btn").click(function () {
				window.location = "add_user.jsp";
			})

		})
	</script>
</head>
<body>
<%--	${users}--%>
<div id="wrap" style="width: 85%">
	<div id="top_content">

		<%@include file="header.jsp"%>
		<div id="content">
			<p id="whereami"></p>
			<h1>Welcome!</h1>
			<table class="table">
				<tr class="table_header">
					<td>ID</td>
					<td> 姓名 </td>
					<td> 密码 </td>
					<td> 电话</td>
					<td> 住址</td>
					<td> 注册时间</td>
					<td> 更新时间</td>
					<td> Status</td>
					<td> Operation</td>
				</tr>
				<c:forEach items="${users}" var="user">
					<tr class="row1">
						<td> ${user.id} </td>
						<td> ${user.name} </td>
						<td> ${user.password} </td>
						<td> ${user.phone} </td>
						<td> ${user.address} </td>
						<td> ${user.createTime} </td>
						<td> ${user.updateTime} </td>
						<td> ${user.status} </td>
						<td>
							<a id="del" href="javascript:;" onclick="del(${user.id})">删除</a>&nbsp;
							<a href="load.user?id=${user.id}">更新</a>
						</td>
					</tr>
				</c:forEach>
				<script>
					function del(id) {
						if(confirm("你确定要这样嘛?")){
							if(confirm("所以爱会消失...对吗?")){
								window.location.href = "delete.user?id=" + id;
							}
						}
					}
				</script>
			</table>
			<p>
				<input id="btn" type="button" class="button" value="用户注册" />
			</p>
		</div>
	</div>
	<%@include file="footer.jsp"%>
</div>
</body>
</html>